package com.efuture.chapterfour

/* @Description: Kotlin语言构造函数默认参数学习
 * @Auther: zhaoshanshan
 * @Date: 2022/03/06/10:34 下午
 */
class Demo67(val name:String = "赵山山") {
    constructor(name:String="刘一凡",age:Int=36):this(name){
        println("两个参数构造函数")
    }
    constructor(name:String="童帅",age:Int=32,sex:Char='男'):this(name){
        println("三个参数构造函数")
    }
    constructor(name:String="陈航",age:Int=30,sex:Char='男',info:String="学习Kotlin"):this(name){
        println("四个参数构造函数")
    }

}

fun main() {
    Demo67("测试名字")
    Demo67("测试名字",33)
    Demo67("测试名字",45,'男')
    Demo67("测试名字",55,'男',"学习Kotlin")
    Demo67()//什么参数都没有传 默认调用主构造函数
}